package com.yutian.selfservice.search.controller;

import com.yutian.selfservice.search.service.KeySearchService;
import com.yutian.selfservice.support.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
/**
 * 页面输入框  输入关键字查询相关的标题
 * @author zuoqiwen
 * @version 1.0
 * @date 2021-09-02
 */
@RestController
@RequestMapping("/search")
public class KeySearchController {
    @Autowired
    private KeySearchService keySearchService;
    /**
     * 关键字查询,根据关键字查询  获取有效标题
     * @param
     * @return
     */
    @RequestMapping("/key")
    @ResponseBody
    public Result search(@NotNull String key) {
        return keySearchService.search(key);
    }
}
